import Vue from 'vue';
import VueRouter from 'vue-router';
import HomeView from '../views/HomeView.vue';
Vue.use(VueRouter);

const routes = [{
        path: '/',
        name: 'home',
        component: HomeView,
        meta: {
            title: '主页',
        },
    },
    {
        path: '/vod',
        name: 'vod',
        component: () =>
            import ('../views/VodView.vue'),
        meta: {
            title: '全部视频',
        },
    },
    {
        path: '/login-password',
        name: 'login-password',
        component: () =>
            import ('../views/LoginPasswordView.vue'),
        meta: {
            title: '密码登录',
        },
    },
    {
        path: '/vod/detail',
        name: 'detail',
        component: () =>
            import ('../views/DetailView.vue'),
        meta: {
            title: '视频详情',
        },
    },
    {
        path: '/study',
        name: 'study',
        component: () =>
            import ('../views/StudyView.vue'),
        meta: {
            title: '在学',
        },
    },
    {
        path: '/member',
        name: 'member',
        component: () =>
            import ('../views/MemberView.vue'),
        meta: {
            title: '我的',
        },
    },
    {
        path: '/user-center',
        name: 'user-center',
        component: () =>
            import ('../views/UserCenter.vue'),
        meta: {
            title: '个人中心',
        },
    },
    {
        path: '/setting',
        name: 'setting',
        component: () =>
            import ('../views/Setting.vue'),
        meta: {
            title: '设置',
        },
    },
    {
        path: '/role',
        name: 'role',
        component: () =>
            import ('../views/Role.vue'),
        meta: {
            title: '会员',
        },
    },
    {
        path: '/order',
        name: 'order',
        component: () =>
            import ('../views/Order.vue'),
        meta: {
            title: '我的订单',
        },
    },
    {
        path: '/invite',
        name: 'invite',
        component: () =>
            import ('../views/Invite.vue'),
        meta: {
            title: '我的邀请码',
        },
    },
    {
        path: '/register',
        name: 'register',
        component: () =>
            import ('../views/Register.vue'),
        meta: {
            title: '快捷登录/注册',
        },
    },
    {
        path: '/message',
        name: 'message',
        component: () =>
            import ('../views/Message.vue'),
        meta: {
            title: '我的消息',
        },
    },
    {
        path: '/video',
        name: 'video',
        component: () =>
            import ('../views/Video.vue'),
        meta: {
            title: '课程视频',
        },
    },
    {
        path: '/pay',
        name: 'pay',
        component: () =>
            import ('../views/Pay.vue'),
        meta: {
            title: '收银台',
        },
    },
];

// 创建一个路由的实例
const router = new VueRouter({
    routes,
});
// 通过es6 export 语法将路由模块进行导出
export default router